// proxy与Reflect
// const testFn = (data) => {
//   console.log("testFn===", data);
// };
// const proxy = new Proxy(testFn, {
//   apply(target, thisArg, args) {
//     return target.call(thisArg, ...args);
//   },
// });
// proxy("hello");

const user = {
  _name: "zhen",
  get name() {
    return this._name;
  },
};
const userProxy = new Proxy(user, {
  get(target, key, receiver) {
    // debugger;
    return Reflect.get(target, key, receiver);
    // console.log("target=", target);
    // console.log("receiver=", receiver);
    // return target[key];
  },
});

const admin = {
  __proto__: userProxy,
  _name: "admin",
};
console.log(admin.name);
